package com.erikpasternak.vader;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class StartFragment extends Fragment implements View.OnClickListener {
	private VaderActivity.VaderStateListener mListener;
	
	public StartFragment() {
	}

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		mListener = ((VaderActivity)activity).getListener();
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle bundle) {
		View view = inflater.inflate(R.layout.start, parent, false);
		view.findViewById(R.id.start).setOnClickListener(this);
		return view;
	}

	public void onClick(View v) {
		if (v.getId() == R.id.start) {
			mListener.onStateChange(VaderActivity.STATE_INTRO);
		}
	}
}
